home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 January: Mac OS SDK / Dev.CD Jan 96 SDK / Dev.CD Jan 96 SDK1.toast / Development Kits (Disc 1) / AOCE / Development Tools / Sample Code / SampleTemplate / Sample Template / Source / AlbumSimplePage2.r < prev    next >
Encoding:
Text File  |  1993-09-07  |  7.8 KB  |  220 lines  |  [TEXT/MPS ]

  1. #include "Types.r"
  2. #include "OCETemplates.h"
  3. #include "OCE.r"
  4.  
  5.  
  6. /////////////////////////////////////////////////////////////////////////
  7. //
  8. // BOOKKEEPING - this is an aspect template with this base resource id
  9. //
  10. /////////////////////////////////////////////////////////////////////////
  11.  
  12. #define kAlbum2ndInfoPageAspect        kDETThirdID
  13.  
  14. resource 'deta' (kAlbum2ndInfoPageAspect, purgeable) {
  15.     0,                    // Drop priority
  16.     dropCheckAlways,    // Drop check flag
  17.     notMainAspect        // Not the main aspect
  18. };
  19.  
  20. resource 'rstr' (kAlbum2ndInfoPageAspect+kDETTemplateName, purgeable) {
  21.     "Album Second Info Page Aspect"
  22. };
  23.  
  24.  
  25.  
  26. /////////////////////////////////////////////////////////////////////////
  27. //
  28. // BINDING - associate this aspect with records of this type
  29. //
  30. /////////////////////////////////////////////////////////////////////////
  31.  
  32. resource 'rstr' (kAlbum2ndInfoPageAspect+kDETRecordType, purgeable) {
  33.     "Album"
  34. };
  35.  
  36.  
  37. // Icons
  38. include "AlbumIcons" 'ICN#'(0) as 'ICN#'(kAlbum2ndInfoPageAspect+kDETAspectMainBitmap, purgeable);
  39. include "AlbumIcons" 'icl4'(0) as 'icl4'(kAlbum2ndInfoPageAspect+kDETAspectMainBitmap, purgeable);
  40. include "AlbumIcons" 'icl8'(0) as 'icl8'(kAlbum2ndInfoPageAspect+kDETAspectMainBitmap, purgeable);
  41.  
  42.  
  43. /////////////////////////////////////////////////////////////////////////
  44. //
  45. // ASPECT PROPERTIES - shared between aspect and info page(s)
  46. //
  47. /////////////////////////////////////////////////////////////////////////
  48.  
  49. #define prNumTracks                    kDETFirstDevProperty
  50. #define prPlayingTimeHours            kDETFirstDevProperty + 1
  51. #define prPlayingTimeMinutes        kDETFirstDevProperty + 2
  52. #define prPlayingTimeSeconds        kDETFirstDevProperty + 3
  53.  
  54.  
  55. //----------------------------------------------------------------------
  56. //
  57. // Lookup resource - what attributes to lookup,
  58. //                     how to assign them to properties
  59. //
  60. //----------------------------------------------------------------------
  61.  
  62. resource 'dett' (kAlbum2ndInfoPageAspect+kDETAspectLookup, purgeable) {
  63.     {
  64.     {"Album Track Info"}, typeBinary,
  65.         useForInput, useForOutput, notInSublist, isNotAlias, isNotRecordRef,
  66.         {
  67.             'word', prNumTracks, 0;
  68.             'long', prPlayingTimeHours, 0;
  69.             'long', prPlayingTimeMinutes, 0;
  70.             'long', prPlayingTimeSeconds, 0;
  71.         };
  72.     }
  73. };
  74.  
  75.  
  76. //----------------------------------------------------------------------
  77. //
  78. // Balloon help for the properties
  79. //
  80. //----------------------------------------------------------------------
  81.  
  82. resource 'rst#' (kAlbum2ndInfoPageAspect+kDETAspectBalloons,purgeable) {
  83.     {
  84.     "The number of tracks on the album.",            "The number of tracks on the album. Uneditable because the record is locked or access controled.",
  85.     "The number of hours of music on the album.",    "The number of hours of music on the album. Uneditable because the record is locked or access controled.",
  86.     "The number of minutes of music on the album.",    "The number of minutes of music on the album. Uneditable because the record is locked or access controled.",
  87.     "The number of seconds of music on the album.",    "The number of seconds of music on the album. Uneditable because the record is locked or access controled.",
  88.     }
  89. };
  90.  
  91.  
  92.  
  93. // --------------------------------------------------------------------
  94. // --------------------------------------------------------------------
  95. //
  96. // Album Information Page
  97. //
  98. // --------------------------------------------------------------------
  99. // --------------------------------------------------------------------
  100.  
  101.  
  102. /////////////////////////////////////////////////////////////////////////
  103. //
  104. // BOOKKEEPING - this is an information page template with this base resource id
  105. //                 and this view
  106. //
  107. /////////////////////////////////////////////////////////////////////////
  108.  
  109. #define kAlbum2ndInfoPage            kDETFourthID
  110.  
  111. resource 'deti' (kAlbum2ndInfoPage, purgeable) {
  112.     2000,
  113.     {0, 0, 0, 0},
  114.     selectFirstText, 
  115.     {
  116.         kDETNoProperty, kDETNoProperty, kAlbum2ndInfoPage;
  117.         kDETNoProperty, kDETNoProperty, kAlbum2ndInfoPage + 1;
  118.         kDETNoProperty, kDETNoProperty, kAlbum2ndInfoPage + 2;
  119.     },
  120.     {
  121.     }
  122. };
  123.  
  124. resource 'rstr' (kAlbum2ndInfoPage+kDETTemplateName, purgeable) {
  125.     "Album 2nd Info Page"
  126. };
  127.  
  128. resource 'rstr' (kAlbum2ndInfoPage+kDETInfoPageName, purgeable) {
  129.     "Track Info"
  130. };
  131.  
  132.  
  133. /////////////////////////////////////////////////////////////////////////
  134. //
  135. // BINDING - associate this information page with records of this type
  136. //             and with this aspect
  137. //
  138. /////////////////////////////////////////////////////////////////////////
  139.  
  140. resource 'rstr' (kAlbum2ndInfoPage+kDETRecordType, purgeable) {
  141.     "Album"
  142. };
  143.  
  144. resource 'rstr' (kAlbum2ndInfoPage+kDETInfoPageMainViewAspect, purgeable) {
  145.     "Album Second Info Page Aspect"
  146. };
  147.  
  148.  
  149. /////////////////////////////////////////////////////////////////////////
  150. //
  151. // VIEWS - what you see in this information page
  152. //
  153. /////////////////////////////////////////////////////////////////////////
  154.  
  155.  
  156. #define kMyFirstColumnLeft                (55)
  157. #define kMyFirstColumnRight                (kMyFirstColumnLeft + 120)
  158. #define kEditTextWidth                    (23)
  159. #define kSpaceBeforeEditDesc            (25)
  160. #define kNumEditColumns                    (3)
  161. #define kMyEditColumnWidth                (70)
  162. #define k1stEditColumnLeft                (kMyFirstColumnRight + 2)
  163. #define k2ndEditColumnLeft                (k1stEditColumnLeft + kMyEditColumnWidth)
  164. #define k3rdEditColumnLeft                (k2ndEditColumnLeft + kMyEditColumnWidth)
  165. #define k4thEditColumnLeft                (k3rdEditColumnLeft + kMyEditColumnWidth)
  166.  
  167. #define kNumTracksTop                    (40)
  168. #define kNumTracksBottom                (kNumTracksTop + kDETAppFontLineHeight + 4)
  169. #define kPlayingTimeTop                    (kNumTracksBottom + 4)
  170. #define kPlayingTimeBottom                (kPlayingTimeTop + kDETAppFontLineHeight + 4)
  171. #define k2ndColumnRightInset            (kDETRecordInfoWindWidth - 10)
  172.  
  173. resource 'detv' (kAlbum2ndInfoPage, purgeable) {
  174.     {
  175.     kDETSubpageIconRect, kDETNoFlags, kDETAspectMainBitmap,
  176.     Bitmap { kDETLargeIcon };
  177.     }
  178. };
  179.  
  180. resource 'detv' (kAlbum2ndInfoPage + 1, purgeable) {
  181.     {
  182.     {kNumTracksTop, kMyFirstColumnLeft, kNumTracksBottom, kMyFirstColumnRight}, kDETNoFlags, kDETNoProperty,
  183.     StaticTextFromView { kDETApplicationFont, kDETApplicationFontSize, kDETRight, kDETBold,
  184.         "Number of tracks:" };
  185.  
  186.     {kNumTracksTop-2, k1stEditColumnLeft, kNumTracksBottom-2, k1stEditColumnLeft + kEditTextWidth}, kDETEnabled + kDETNumericOnly, prNumTracks,
  187.     EditText { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal };
  188.     }
  189. };
  190.  
  191. resource 'detv' (kAlbum2ndInfoPage + 2, purgeable) {
  192.     {
  193.     {kPlayingTimeTop, kMyFirstColumnLeft, kPlayingTimeBottom, kMyFirstColumnRight}, kDETNoFlags, kDETNoProperty,
  194.     StaticTextFromView { kDETApplicationFont, kDETApplicationFontSize, kDETRight, kDETBold,
  195.         "Total playing time:" };
  196.  
  197.     {kPlayingTimeTop-2, k1stEditColumnLeft, kPlayingTimeBottom-2, k1stEditColumnLeft + kEditTextWidth}, kDETEnabled + kDETNumericOnly, prPlayingTimeHours,
  198.     EditText { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal };
  199.  
  200.     {kPlayingTimeTop, k1stEditColumnLeft + kSpaceBeforeEditDesc, kPlayingTimeBottom, k2ndEditColumnLeft}, kDETNoFlags, kDETNoProperty,
  201.     StaticTextFromView { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal,
  202.         "Hours" };
  203.  
  204.     {kPlayingTimeTop-2, k2ndEditColumnLeft, kPlayingTimeBottom-2, k2ndEditColumnLeft + kEditTextWidth}, kDETEnabled + kDETNumericOnly, prPlayingTimeMinutes,
  205.     EditText { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal };
  206.  
  207.     {kPlayingTimeTop, k2ndEditColumnLeft + kSpaceBeforeEditDesc, kPlayingTimeBottom, k3rdEditColumnLeft}, kDETNoFlags, kDETNoProperty,
  208.     StaticTextFromView { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal,
  209.         "Minutes" };
  210.  
  211.     {kPlayingTimeTop-2, k3rdEditColumnLeft, kPlayingTimeBottom-2, k3rdEditColumnLeft + kEditTextWidth}, kDETEnabled + kDETNumericOnly, prPlayingTimeSeconds,
  212.     EditText { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal };
  213.  
  214.     {kPlayingTimeTop, k3rdEditColumnLeft + kSpaceBeforeEditDesc, kPlayingTimeBottom, k4thEditColumnLeft}, kDETNoFlags, kDETNoProperty,
  215.     StaticTextFromView { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal,
  216.         "Seconds" };
  217.     }
  218. };
  219.  
  220.